﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Smartec.Accounts.Camel.AMS.Model.Entities;
using Smartec.Accounts.Camel.AMS.Model.Repository;
using Smartec.Accounts.Camel.AMS.Model.Managers;

namespace Smartec.Accounts.Camel.AMS.Model.Facades
{
    public static class RoleControllerFacade
    {
        //
        // Query Methods

        public static IEnumerable<AMSController> FindAllControllers()
        {
            return RoleControllerRepository.FindAllControllers();
        }

        public static IEnumerable<RoleController> GetRoleControllers(string roleName)
        {
            return RoleControllerRepository.GetRoleControllers(roleName);
        }

        public static bool AuthorizeAction(string controllerName, string actionName, string[] roles)
        {
            return AdministrationManager.AuthorizeAction(controllerName, actionName, roles);
        }

        public static Role GetRole(string roleName)
        {
            return RoleControllerRepository.GetRole(roleName);
        }

        public static AMSController GetController(int id)
        {
            return RoleControllerRepository.GetController(id);
        }

        public static void Delete(RoleController roleController)
        {
            RoleControllerRepository.Delete(roleController);
        }

        //
        // Persistence 

        public static void Save()
        {
            RoleControllerRepository.Save();
        }

        // Helper Methods
    }
}
